﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Shop.Data;

namespace Shop.CartResources
{
    public class WeightItem : ICartItem
    {
        public string Barcode {get; set; }
        public string Specification { get; set; }
        public decimal Price { get; set; }
        public decimal? WeightBought { get; set; }

        public WeightItem(ShopItem innerItem, decimal? weightToBuy)
        {
            this.Barcode = innerItem.Barcode;
            this.Specification = innerItem.Specification;
            this.Price = innerItem.Price * (weightToBuy.GetValueOrDefault());
            this.WeightBought = weightToBuy;
        }
    }
}
